package lab02.test30;

/**
 * Created by ASUS on 2017/11/15.
 */
import java.util.*;
public class Test {
    static double average;

    public static void main(String[] args) {
        double markIn;
        Scanner sc = new Scanner(System.in);
        List<Double> marks = new ArrayList<Double>();
        do {
            System.out.println("请输入一位学生的成绩：");
            markIn=sc.nextDouble();
            marks.add(markIn);
        }
        while(markIn>0);
        int len=marks.size()-1;
        marks.remove(len);
        for(int i=0;i<len;i++){
            average+= marks.get(i) / len;
        }
        System.out.println(len + "名学生的成绩平均分为："+ average);
    }
}
